﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  

</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/content">内容管理</a></li>
          <li class="active">文章管理</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">

          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>文章管理&nbsp;-&nbsp;创建文章</span></h2>
            </div>
          </div>
          
          <form class="form-horizontal" method="POST" action="${ctx.host}/articles" data-validate="true" data-redirect="${ctx.host}/articles">
            
            <div class="form-group x-form-group">
              <label class="col-xs-2 control-label" style="text-align: left; width: 10%;">文章标题</label>
              <div class="pull-left col-xs-8" >
                <input type="text" name="name" class="form-control" data-validate="required">
              </div>
            </div>
            
            <div class="form-group x-form-group no-hover">
              <label class="col-xs-2 control-label" style="text-align: left; width: 10%;">文章封面:</label>
              <div class="col-xs-8 pull-left upload-cover" style="width: 450px; height: 270px;">
                <button type="button" id="pickCover" class="edit-btn"><span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>&nbsp;&nbsp;选择文件</button>
                <div id="coverPreviewList">
                  <img id="coverPreview" src=""/>
                </div>
                <label id="messageCover" class="control-label messageCover hide"></label>
              </div>
              <input type="hidden" id="cover" name="cover" value="" data-validate="required"/>
            </div>
            
            <div class="form-group x-form-group">
              <label class="col-xs-2 control-label" style="text-align: left; width: 10%;">文章类别</label>
              <div class="pull-left col-xs-8" >
                <select name="moduleIds" multiple class="form-control" data-size="5" data-validate="required">
                  <c:forEach var="module" items="${persist.modules}">
                  	<c:if test="${not module.value.disabled}">
                    	<option value="${module.key}" ${module.key eq param.moduleId ? 'selected' : ''}>${module.value.name}</option>
                    </c:if>
                  </c:forEach>
                </select>
              </div>
            </div>
            
            <div class="form-group x-form-group">
              <label class="col-xs-2 control-label" style="text-align: left; width: 10%;">文章简介</label>
              <div class="pull-left col-xs-8">
                <textarea type="text" name="summary" class="form-control" data-validate="required" rows="4" style="width: 100%;"></textarea>
              </div>
            </div>
            
            <div class="form-group x-form-group">
              <label class="col-xs-2 control-label" style="text-align: left; width: 10%;">文章链接</label>
              <div class="pull-left col-xs-8">
                <textarea type="text" name="link" class="form-control" data-validate="required|www" rows="4" style="width: 100%;"></textarea>
              </div>
            </div>
            
            <div class="modal-footer">
              
              <button id="createMaterial" type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
              <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
              
            </div>
            
          </form>
          
        </div>
        
        
        
      </div>
      
    </div>
    
  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/content/article/article-create.js">
    <script type="text/javascript">
      require(['page/content/article/article-create'], function(page) {
        page.init()
      })
    </script>
  </d:resource>
</body>

</html>